/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.vote.entity;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name = "cooperative_area")
public class CooperativeArea implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long id;
	private String name;
	private String picurl;
	private Date createtime;
	private Integer status;
	private List<Cooperative> cooperList = new ArrayList<Cooperative>();
	/* ---------------- method ----------------*/
	
	public CooperativeArea(){
	}

	public CooperativeArea(Long id){
		this.id = id;
	}

	/* ---------------- getter/setter ----------------*/
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "name")
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name = "picurl")
	public String getPicurl() {
		return picurl;
	}
	
	public void setPicurl(String picurl) {
		this.picurl = picurl;
	}
	
	@Column(name = "createTime")
	public Date getCreatetime() {
		return createtime;
	}
	
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	
	@Column(name = "status")
	public Integer getStatus() {
		return status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
	}

	@JsonIgnore
	@OneToMany(mappedBy = "area")
	public List<Cooperative> getCooperList() {
		return cooperList;
	}
	public void setCooperList(List<Cooperative> cooperList) {
		this.cooperList = cooperList;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}



